<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
        xmlns:c="http://java.sun.com/jstl/core" 
        xmlns:p="http://primefaces.org/ui"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        
        >

    <ui:composition template="template.xhtml">
        <ui:define name="content">
    
    <div id="body">
        <div class="panel">

            <h2>Create Your Account</h2>

            <p:messages />

            <h:form>
 <p:messages id="messages"  autoUpdate="true"/>  
                <div class="zoneEditor">
                    <h3>Personal information</h3>

                    <p:panelGrid columns="2">
                        <h:outputText value="Login :"/>
                        <p:inputText value="#{account.customer.login}" readonly="true"/>

                        <h:outputText value="*Firstname :"/>
                        <p:inputText value="#{account.customer.firstname}" required="true" requiredMessage="Firstname is required"/>

                        <h:outputText value="*Lastname :"/>
                        <p:inputText value="#{account.customer.lastname}" required="true" requiredMessage="Lastname is required"/>

                        <h:outputText value="Email :"/>
                        <p:inputText value="#{account.customer.email}"/>

                        <h:outputText value="Telephone :"/>
                        <p:inputText value="#{account.customer.telephone}"/>

                        <h:outputText value="Date of birth (dd.MM.yyyy):"/>
                        <p:inputText value="#{account.customer.dateOfBirth}">
                            <f:convertDateTime pattern="dd.MM.yyyy"/>
                        </p:inputText>

                    </p:panelGrid>
                </div>

                <div class="zoneEditor">
                    <h3>Address</h3>

                    <p:panelGrid columns="2">
                        <h:outputText value="*Street1 :"/>
                        <p:inputText value="#{account.homeAddress.street1}" required="true" requiredMessage="Street1 is required"/>

                        <h:outputText value="Street2 :"/>
                        <p:inputText value="#{account.homeAddress.street2}" requiredMessage="Street2 is required"/>

                        <h:outputText value="*City :"/>
                        <p:inputText value="#{account.homeAddress.city}" required="true" requiredMessage="City is required"/>

                        <h:outputText value="State :"/>
                        <p:inputText value="#{account.homeAddress.state}" />

                        <h:outputText value="*Zipcode :"/>
                        <p:inputText value="#{account.homeAddress.zipcode}" required="true" requiredMessage="Zipcode is required"/>

                        <h:outputText value="*Country :"/>
                        <p:inputText value="#{account.homeAddress.country}" required="true" requiredMessage="Country is required"/>

                    </p:panelGrid>
                </div>

                <div class="zoneButton">
                    <p:commandButton value="Submit" action="#{account.doCreateCustomer}" type="submit"/>
                </div>
            </h:form>

        </div>
    </div>
          
</ui:define>
	
        
    </ui:composition>
</html>